package com.wfcm.service.impl;

import com.wfcm.dao.WfCourseWorkDao;
import com.wfcm.entity.CourseWork;
import com.wfcm.service.WfCourseWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class WfCourseWorkServiceImpl implements WfCourseWorkService {

    @Autowired
    private WfCourseWorkDao courseWorkDao;

    @Override
    public List<CourseWork> myCourseWork(Integer userId) {
        return courseWorkDao.courseIdAndChapterId(userId);
    }

    @Override
    public Integer finishedCourseWork(Integer userId) {
        return courseWorkDao.finishedCourseWork(userId);
    }

    @Override
    public List<CourseWork> myCourseWorkList(CourseWork courseWork) {
        return courseWorkDao.myCourseWorkList(courseWork);
    }

    @Override
    public List<CourseWork> queryMyCourseWork(Integer userId) {
        return courseWorkDao.queryMyCourseWork(userId);
    }

    @Override
    public CourseWork queryCourseWorkByChapterId(CourseWork courseWork) {
        return courseWorkDao.queryCourseWorkByChapterId(courseWork);
    }

    @Override
    public CourseWork queryMemberWork(CourseWork courseWork) {
        return courseWorkDao.queryMemberWork(courseWork);
    }

    @Override
    public Integer selectCount(Integer userid) {
        return courseWorkDao.selectCount(userid);
    }

    @Override
    public Integer insertMemberWork(CourseWork courseWork) {
        return courseWorkDao.insertMemberWork(courseWork);
    }

    @Override
    public Integer updateMemberWork(CourseWork courseWork) {
        return courseWorkDao.updateMemberWork(courseWork);
    }
}
